package com.useeinfo.oa.common.utils.exception.view;

import com.useeinfo.oa.common.exception.MyException;
import com.useeinfo.oa.common.exception.dto.ExceptionDto;
import com.useeinfo.oa.common.utils.exception.JudgmentView;

/**
 * @author geniusj
 * @email 975473185@qq.com
 * @date 2018/8/20  下午3:06
 */
public class MyExceptionJudgmentView implements JudgmentView {

    private static final String MY_EXCEPTION_VIEW =  "/error/500";

    private MyException exception;

    public MyExceptionJudgmentView(MyException exception) {
        this.exception = exception;
    }

    @Override
    public ExceptionDto getViewDetail() {
        return new ExceptionDto(exception, exception.getMsg(),exception.getResultEnums(),MY_EXCEPTION_VIEW);
    }
}
